#ifndef __VIDEO_PLAYER_H__
#define __VIDEO_PLAYER_H__

#include <thread>
#include <queue>
#include "rgb24_video.h"
#include "drm_encap.h"
#include "clocker.h"

class VideoPlayer
{
public:
    VideoPlayer();
    ~VideoPlayer();

public:
    int start(void);  // 播放
    int pause(void);  // 暂停
    int stop(void);  // 结束

private:
    int start_thread_frame(void);  // 帧缓冲线程
    int start_thread_player(void);  // 播放线程

private:
    bool m_start_flag;
    bool m_pause_flag;
    bool m_stop_flag;

    std::thread *player;
    std::thread *frame;

    struct rgb24_object *m_rgb;

    std::queue<int> *m_frame_index;
};

#endif//__VIDEO_PLAYER_H__